package com.bdcom.config;

import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.context.annotation.PropertySource;
import org.springframework.data.mongodb.config.AbstractMongoConfiguration;
import org.springframework.data.mongodb.repository.config.EnableMongoRepositories;

import com.mongodb.Mongo;
import com.mongodb.MongoClient;

@Configuration
@EnableAspectJAutoProxy
@EnableMongoRepositories(basePackages="com.bdcom.repository")
@ComponentScan(basePackages={"com.bdcom"})
@PropertySource(value="classpath:application.properties")
public class SpringConfig extends AbstractMongoConfiguration{
	
//	@Autowired
//	private Environment enviroment;

	@Override
	protected String getDatabaseName() {
		// TODO Auto-generated method stub
		return "plannerdb";
	}

	@Override
	public Mongo mongo() throws Exception {
		// TODO Auto-generated method stub
		return new MongoClient();
	}

}
